<?php

/**
 * This is the model metadata class for table "goods".
 */
class GoodsMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'goods';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('title', 'required'),
			array('class_id, type_id, provider_id, is_recommend', 'numerical', 'integerOnly'=>true),
			array('short_title', 'length', 'max'=>20),
			array('title', 'length', 'max'=>100),
			array('thumb', 'length', 'max'=>255),
			array('status, object_type, listing_status', 'length', 'max'=>50),
			array('create_time, update_time, listing_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, short_title, title, thumb, status, class_id, type_id, object_type, listing_status, provider_id, create_time, is_recommend, update_time, listing_time', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'short_title' => 'Short Title',
			'title' => 'Title',
			'thumb' => 'Thumb',
			'status' => 'Status',
			'class_id' => 'Class',
			'type_id' => 'Type',
			'object_type' => 'Object Type',
			'listing_status' => 'Listing Status',
			'provider_id' => '供应商',
			'create_time' => 'Create Time',
			'is_recommend' => '是否推荐',
			'update_time' => 'Update Time',
			'listing_time' => '上架时间',
		);
	}
}